ElectrumSyncClient: Skip unconfirmed get_history entries#4341
ElectrumSyncClient: Skip unconfirmed get_history entries#4341TheBlueMatt merged 1 commit intolightningdevkit:mainfrom
ElectrumSyncClient: Skip unconfirmed get_history entries#4341Conversation
|
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
TheBlueMatt
left a comment
There was a problem hiding this comment.
Would be kinda nice to have a test for this, but I'm okay with that just living in ldk-node
|
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4341 +/- ##
=======================================
Coverage 86.78% 86.79%
=======================================
Files 158 158
Lines 102788 102788
Branches 102788 102788
=======================================
+ Hits 89206 89210 +4
+ Misses 11236 11232 -4
Partials 2346 2346
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9f3970e to
ac0dba3
Compare
ac0dba3 to
115ab6d
Compare
Electrum's `blockchain.scripthash.get_history` will return the *confirmed* history for any scripthash, but will then also append any matching entries from the mempool, with respective `height` fields set to 0 or -1 (depending on whether all inputs are confirmed or not). Unfortunately we previously only included a filter for confirmed `get_history` entries in the watched output case, and forgot to add such a check also when checking for watched transactions. This would have us treat the entry as confirmed, then failing on the `get_merkle` step which of course couldn't prove block inclusion. Here we simply fix this omission and skip entries that are still unconfirmed (e.g., unconfirmed funding transactions from 0conf channels). Signed-off-by: Elias Rohrer <dev@tnull.de>
115ab6d to
cc1eb16
Compare
|
Backported to 0.2 in #4344 |
|
Backported to 0.1 in #4343 |
[0.1] Backport #4341 and cut 0.1.9
Electrum's
blockchain.scripthash.get_historywill return the confirmed history for any scripthash, but will then also append any matching entries from the mempool, with respectiveheightfields set to 0 or -1 (depending on whether all inputs are confirmed or not).Unfortunately we previously only included a filter for confirmed
get_historyentries in the watched output case, and forgot to add such a check also when checking for watched transactions. This would have us treat the entry as confirmed, then failing on theget_merklestep which of course couldn't prove block inclusion. Here we simply fix this omission and skip entries that are still unconfirmed (e.g., unconfirmed funding transactions from 0conf channels).